const { merge } = require('webpack-merge')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const common = require('./webpack.common')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')

const path = require('path')
console.log(process.env.NODE_ENV)

module.exports = merge(common, {
  mode: 'production',
  plugins: [
    new CleanWebpackPlugin(),
    new CopyWebpackPlugin({
        patterns: [
            { 
              from: __dirname + '/public', 
              to: __dirname + '/dist'
            },
        ]
    })
  ]
})
